import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import store from './store'
import ElementUI from 'element-ui'
import {Message ,Loading,MessageBox,Notification} from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/common.css';   //一种外部css引入方式
import './assets/css/style.css';   //一种外部css引入方式
import {getRequest} from './utils/api'
import {postRequest} from './utils/api'
import {deleteRequest} from './utils/api'
import {putRequest} from './utils/api'
// 引入了echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

//引用store
Vue.prototype.$store = store
//引用axios
axios.defaults.baseURL = store.state.address+'/api'
axios.defaults.timeout = 5000
axios.defaults.withCredentials = true
Vue.prototype.$axios = axios;

//引用js方法
Vue.prototype.getRequest = getRequest;
Vue.prototype.postRequest = postRequest;
Vue.prototype.deleteRequest = deleteRequest;
Vue.prototype.putRequest = putRequest;

//引用element
Vue.prototype.$message = Message;
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.use(ElementUI)

//加载全局组件


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
